<template>
  <div>
    <!--引用表格-->
   <BasicTable @register="registerTable" >
      <!-- <template #form-createTimeSlot="{model,field}">
            <a-range-picker @change="onRangeChange" valueFormat="YYYY-MM-DD">
            </a-range-picker>
      </template> -->
     <!--插槽:table标题-->
      <template #tableTitle>
  
      </template>
      
      <!--字段回显插槽-->
      <template v-slot:bodyCell="{ column, record, index, text }">
      </template>
    </BasicTable>


  </div>
</template>

<script lang="ts" name="acauthchangerecord-acAuthChangeRecord" setup>
  import {ref, reactive, computed, unref} from 'vue';
  import {BasicTable, useTable, TableAction} from '/@/components/Table';
  import {useModal} from '/@/components/Modal';
  import { useListPage } from '/@/hooks/system/useListPage'
  import {columns, searchFormSchema} from './AcAuthChangeRecord.data';
  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AcAuthChangeRecord.api';
  import { downloadFile } from '/@/utils/common/renderUtils';
  import { useUserStore } from '/@/store/modules/user';
  const queryParam = reactive<any>({});
  const checkedKeys = ref<Array<string | number>>([]);
  const userStore = useUserStore();
  //注册table数据
  const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
      tableProps:{
           title: '授权变更记录',
           api: list,
           columns,
           canResize:false,
           showActionColumn:false,
           formConfig: {
              //labelWidth: 120,
              schemas: searchFormSchema,
              autoSubmitOnEnter:true,
              showAdvancedButton:true,
              fieldMapToNumber: [
              ],
              fieldMapToTime: [
                 ['createTime', ['createTimeBegin', 'createTimeEnd'], 'YYYY-MM-DD'],
              ],
            },
           actionColumn: {
               width: 120,
               fixed:'right'
            },
            beforeFetch: (params) => {
              return Object.assign(params, queryParam);
            },
      }
      
  })

  const [registerTable, {reload,getForm},{ rowSelection, selectedRowKeys }] = tableContext

  // async  function onRangeChange(e){
  //   console.log(e)
  //    let { getFieldsValue,setFieldsValue, } =  getForm()
  //   let data = getFieldsValue()
  //   data.createTimeBegin  = e[0]
  //   data.createTimeEnd  = e[1]
  //   await setFieldsValue(data)
  // }
  /**
   * 高级查询事件
   */
  function handleSuperQuery(params) {
    Object.keys(params).map((k) => {
      queryParam[k] = params[k];
    });
    reload();
  }
  

  

</script>

<style scoped>

</style>
